<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>函数参数</title>
</head>

<body>
    <script>
        function foo(x = 10, y) {
            console.log(x, y);
        }
        foo(1);



        // // name: 形参，任意变量名
        // function sayHello(name = '王五', age = 18) {
        //     console.log("你好");
        //     console.log("我叫" + name);
        //     console.log("今年" + age + '岁。');
        // }

        // // "张三"：实参，实际的数据
        // sayHello("张三", 20);
        // sayHello("李四", 19);
        // sayHello();


    </script>
</body>

</html>